<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<h4 align="center">所有合同</h4>
	<table border="1" cellspacing="0" cellpadding="3" align="center">
		<tr>
		<th>ID</th>
		<th>销售员</th>
		<th>顾客</th>
		<th>金额</th>
		<th>签约时间</th>
		<th>状态</th>
		<th>详情</th>
		<th>操作</th>
		</tr>
		<c:forEach items="${requestScope.contracts }" var="g">
			<tr>
				<td>${g.contractId }</td>
				<td>${g.salesMan }</td>
				<td>${g.customer }</td>
				<td>${g.money }</td>
				<td><fmt:formatDate type="both" value="${g.time}"/></td>
				<td>${g.states }</td>
				<td>
					<a href="${pageContext.request.contextPath }/contract/getDetails/${g.contractId}">详情</a>
				</td>
				<td>
					<a href="${pageContext.request.contextPath }/contract/edit/${g.contractId}">修改</a>
					<a href="${pageContext.request.contextPath }/contract/deleteContract/${g.contractId}">删除</a>
				</td>
			</tr>
		</c:forEach>
	</table>
	<table align="center">
	<tr>
		<td>
			<form action="${pageContext.request.contextPath }/contract/input" method="post"
			 style="width: 70%; margin: auto">
				<input type="submit" value="新签一个合同">
			</form>
		</td>
		<td>
			<form action="${pageContext.request.contextPath }/contract/inputCondition" method="post"
			 style="width: 30%; margin: auto">
				<input type="submit" value="查询">
			</form>
		</td>
		<td>
		<form action="${pageContext.request.contextPath }/contract/toPage/login/salesAdminPage" method="post"
		 style="width: 30%; margin: auto">
			<input type="submit" value="返回">
		</form>
		</td>
	</tr>
	</table>
</body>
</html>